# -*- coding:utf-8 -*-
# @Time    :2022/1/15 0015 18:26
# AUTHOR   :JUNWEI
# @Email   :2328014713@qq.com
# @File    :urls.py
# @Software:PyCharm

from django.urls import path
from .views import StudentViewSet ,DepartmentViewSet
from rest_framework.routers import SimpleRouter

urlpatterns = [
    # path('student/', StudentViewSet.as_view({'get': 'list', 'post': 'create'})),
    # path('student/<pk>/', StudentViewSet.as_view({'get': 'retrieve', 'put': 'update', 'delete':'destory'}))
]
router = SimpleRouter() # 创建路由器
router.register('student',StudentViewSet) # 注册路由
router.register('department',DepartmentViewSet) # 注册路由
urlpatterns += router.urls # 拼接路由
